package org.JWCB.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 定义状态码
 */
@Getter
@AllArgsConstructor
public enum ResultCode {

    //操作成功
    SUCCESS (1000, "操作成功"),

    //服务器内部错误，友好提示
    ERROR (2000, "服务繁忙请稍后重试"),

    //操作失败，但是服务器不存在异常
    FAILED (3000, "操作失败"),
    FAILED_UNAUTHORIZED (3001, "未授权"),
    FAILED_PARAMS_VALIDATE (3002, "参数校验失败"),
    FAILED_NOT_EXISTS (3003, "资源不存在"),
    FAILED_ALREADY_EXISTS (3004, "资源已存在"),
    FAILED_ALREADY_BIND(3005,"资源被绑定"),

    FAILED_REQUEST_METHOD_NO_SUPPORTED(3005,"请求方式不支持"),
    AILED_USER_EXISTS (3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS (3102, "用户不存在"),
    FAILED_LOGIN (3103, "用户名或密码错误"),
    FAILED_USER_BANNED (3104, "您已被列入黑名单, 请联系管理员."),
    FREQUENT_OPERATION(3105,"操作频繁,请稍后重试"),
    MAXIMUM_NUM_OF_TIMES(3106,"单日获取验证码限制"),
    FAILED_SEND_CODE(3107,"验证码发送失败"),
    INCORRECT_CODE(3108,"验证码校验失败"),
    INVALID_CODE(3109,"无效的验证码"),
    MAXIMUM_NUM_OF_TIMES_UPLOAD(3110,"单日图片上传次数限制"),
    PHONE_HAS_BEAN_BINDING(3111,"手机已被其他用户绑定"),


    QUESTION_HAS_BEAN_TIED_TO_THE_EXAM(3501,"题目已经被竞赛绑定"),
    FIRST_QUESTION(3502,"已经是第一道题目了"),
    LAST_QUESTION(3502,"已经是最后一道题目了"),



    FAILED_FILE_UPLOAD(4050,"文件上传失败"),
    FILE_EMPTY(4051,"文件为空"),
    IMAGE_FILE_TYPE_ERROR(4052,"不支持的图片文件"),
    FILE_TOO_BIG(4043,"文件过大"),


    EXAM_TIME_ERROR(4001,"竞赛时间不符合标准或时间不规范"),
    EXAM_NOT_EXIST(4002,"竞赛不存在"),
    QUESTION_NOT_EXIST(4003,"竞赛中有题目不存在,请尝试刷新后重新添加"),
    QUESTION_ALREADY_EXIST(4004,"题目已经存在"),
    EXAM_HAVE_STARTED(4005,"竞赛已经开赛,不支持操作"),
    EXAM_HAVE_END(4006,"竞赛已经结束,不支持操作"),
    EXAM_EMPTY_QUESTION(4007,"竞赛中不包含题目"),
    EXAM_ALREADY_PUBLISH(4008,"竞赛已经发布,不支持操作"),
    EXAM_NOT_START(4009,"竞赛未开始"),
    EXAM_QUESTION_NUM_NOT_MATCH(4010,"竞赛题目数量不一致,请刷新后重试"),

    USER_HAS_SIGNED_UP_EXAM(4101,"用户重复报名"),


    FAILED_NOT_SUPPORT_PROGRAM_TYPE(4201,"不支持的语言类型"),
    FAILED_CODE_STRUCTURE_ERROR(4202,"代码结构错误"),


    SUBMIT_MAX_COUNT(4501,"上传频繁"),
    ;
    /**
     * 状态码
     */
    private int code;
    /**
     * 状态描述
     */
    private String msg;
}
